package com.guigu.eduservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDateTime;

/**
 * <p>
 * 设备表（存储卖家发布的二手机械信息）
 * </p>
 *
 * @author Xiaosong
 * @since 2025-10-05
 */
@Data
@TableName("equipment")
public class Equipment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 设备唯一标识
     */
    @TableId(value = "equipment_id", type = IdType.AUTO)
    private Long equipmentId;

    /**
     * 关联用户表user_id（设备发布者，即卖家）
     */
    private Long userId;



    /**
     * 设备品牌（如三一、徐工、卡特彼勒）
     */
    private String brand;

    /**
     * 设备型号（如SY215C、LW500FV）
     */
    private String model;

    /**
     * 设备生产年份（如2020）
     */
    private Integer year;

    /**
     * 设备使用小时数（反映设备磨损程度）
     */
    private Integer hour;

    /**
     * 设备价格（单位：元，精确到分）
     */
    private BigDecimal price;

    /**
     * 垂直高度（单位：米，如起重机的最大起升高度）
     */
    private BigDecimal verticalHeight;

    /**
     * 底盘桥数（如2桥、3桥，用于描述车辆底盘结构）
     */
    private Integer chassisAxle;

    /**
     * 支腿形式（如H型、X型，用于起重机等设备）
     */
    private String outriggerType;

    /**
     * 排放标准（如国三、国四，反映环保合规性）
     */
    private String emissionStandard;

    /**
     * 设备所在地（省/市/区，如广东省深圳市南山区）
     */
    private String location;

    /**
     * 联系人（设备咨询的对接人）
     */
    private String contactName;

    /**
     * 联系电话（设备咨询的联系方式）
     */
    private String contactPhone;

    /**
     * 设备描述（富文本格式，含设备使用情况、维护记录等）
     */
    private String description;

    /**
     * 设备状态（0-未审核，1-已上架，2-已下架，3-已成交）
     */
    private Integer status;

    /**
     * 是否已检测（0-否，1-是；检测后生成检测报告）
     */
    private Integer isDetected;

    /**
     * 关联检测报告表detection_report_id（is_detected=1时必填）
     */
    private Long detectionReportId;

    /**
     * 发布时间（用户提交设备发布申请的时间）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime releaseTime;

    /**
     * 审核时间（设备状态变更为1或2时记录）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime auditTime;

    /**
     * 记录创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 记录更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime updateTime;
    /**
     * 其他表中的一列，关联其他表
     * **/
    private Long typeId;
    /**
     * 其他表中的一列，关联其他表
     * **/
    @TableField(exist = false)
    private String imageUrl;
    @TableField(exist = false)
    private String typeName;
    @TableField(exist = false)
    private String videoUrl;


    public Long getEquipmentId() {
        return equipmentId;
    }

    public void setEquipmentId(Long equipmentId) {
        this.equipmentId = equipmentId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getHour() {
        return hour;
    }

    public void setHour(Integer hour) {
        this.hour = hour;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getVerticalHeight() {
        return verticalHeight;
    }

    public void setVerticalHeight(BigDecimal verticalHeight) {
        this.verticalHeight = verticalHeight;
    }

    public Integer getChassisAxle() {
        return chassisAxle;
    }

    public void setChassisAxle(Integer chassisAxle) {
        this.chassisAxle = chassisAxle;
    }

    public String getOutriggerType() {
        return outriggerType;
    }

    public void setOutriggerType(String outriggerType) {
        this.outriggerType = outriggerType;
    }

    public String getEmissionStandard() {
        return emissionStandard;
    }

    public void setEmissionStandard(String emissionStandard) {
        this.emissionStandard = emissionStandard;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsDetected() {
        return isDetected;
    }

    public void setIsDetected(Integer isDetected) {
        this.isDetected = isDetected;
    }

    public Long getDetectionReportId() {
        return detectionReportId;
    }

    public void setDetectionReportId(Long detectionReportId) {
        this.detectionReportId = detectionReportId;
    }

    public LocalDateTime getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(LocalDateTime releaseTime) {
        this.releaseTime = releaseTime;
    }

    public LocalDateTime getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(LocalDateTime auditTime) {
        this.auditTime = auditTime;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Equipment{" +
            "equipmentId = " + equipmentId +
            ", userId = " + userId +
            ", brand = " + brand +
            ", model = " + model +
            ", year = " + year +
            ", hour = " + hour +
            ", price = " + price +
            ", verticalHeight = " + verticalHeight +
            ", chassisAxle = " + chassisAxle +
            ", outriggerType = " + outriggerType +
            ", emissionStandard = " + emissionStandard +
            ", location = " + location +
            ", contactName = " + contactName +
            ", contactPhone = " + contactPhone +
            ", description = " + description +
            ", status = " + status +
            ", isDetected = " + isDetected +
            ", detectionReportId = " + detectionReportId +
            ", releaseTime = " + releaseTime +
            ", auditTime = " + auditTime +
            ", createTime = " + createTime +
            ", updateTime = " + updateTime +
                ", getTypeId = " + typeId  +
        "}";
    }
}
